import 'package:flutter_ahj_app/app/regist/bean/message_code.dart';
import 'package:flutter_ahj_app/app/regist/model/RegistModel.dart';
import 'package:flutter_ahj_app/base/basewidget/viewmodel/BaseViewModel.dart';

class RegistViewModel extends BaseViewModel<RegistModel> {
  @override
  RegistModel get initModel => RegistModel();

  Stream<Map> getAddressStream() => model.addressSubject;

  getAddress(String name, String code) {
    return model.getData(name, code);
  }

  /*
  * 用户注册
  * 用户名
  * 密码
  * 昵称
  *员工等级
  * 个人工时费
  * */
  setRegistData(
      String name,
      String password,
      String locationProvince,
      String locationProvinceCode,
      String locationCity,
      String locationCityCode,
      String locationDistrict,
      String locationDistrictCode) {
    return model.getRegistData(
        name,
        password,
        locationProvince,
        locationProvinceCode,
        locationCity,
        locationCityCode,
        locationDistrict,
        locationDistrictCode);
  }

  getCheckData(String phone) {
    return model.getCheckData(phone);
  }

  userCheckCode(String phone, String code) {
    return model.userCheckCode(phone, code);
  }

  Stream<MessageCode> getDataStream() => model.dataStream;

  Stream<MessageCode> getCodeCheckDataStream() => model.codeStream;

  Stream<MessageCode> getRegistDataStream() => model.registCodeStream;

  Stream errStream() => model.errorStream;
}
